package cn.alibab.cangku.service.impl;


import cn.alibab.cangku.dao.AreaDao;
import cn.alibab.cangku.service.AreaService;
import cn.alibab.cangku.vo.ProductVo;
import cn.alibab.common.model.R;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AreaServiceImpl implements AreaService {
    private final AreaDao areaDao;

    public AreaServiceImpl(AreaDao areaDao) {
        this.areaDao = areaDao;
    }

    @Override
    public R findByArea(String area) {
        List<ProductVo> productVos = areaDao.findByArea(area);
        System.out.println(productVos.size());
        return R.ok(productVos);
    }
}
